﻿using UnityEngine;
using System.Collections;

public class MainMenuScript : MonoBehaviour {

	public Texture2D newgame;
	public Texture2D continuegame;
	public Texture2D quitscreen;
	public Texture2D settingscreen;
	public Texture2D helpscreen;
	public Texture2D Icon;
	
	void OnGUI ()
	{
		const int buttonWidth = 200;
		const int buttonHeight = 120;
		int buttonNo = 5;
		int ButtonDistance = 80;

		//int ScreenHeight = Screen.height;
		//int MinusAmount = ScreenHeight * 0.8;

		GUI.DrawTexture (new Rect (	(Screen.width / 2) - 125,
		                         	(Screen.height - 600),
		                        	250,
		                         	150),
						Icon);


		// Draw a button for Start Game
		if 	(GUI.Button (new Rect (	(Screen.width / 2 - buttonWidth / 2) ,
		                           	(Screen.height - (buttonNo*ButtonDistance)),
									buttonWidth,
									buttonHeight),
						newgame,		// Texture Name
						GUIStyle.none)
			) 
		{
			// On Click, load the first level.
			// "Stage1" is the name of the first scene we created.
			Application.LoadLevel ("GameScreen");
		}
		buttonNo--;

		// Draw a button for Options
		if 	(GUI.Button (new Rect (	(Screen.width / 2) - (buttonWidth / 2),
		                           	(Screen.height - (buttonNo*ButtonDistance)),
									buttonWidth,
									buttonHeight),
						continuegame,
						GUIStyle.none)
			)
		{
			// On Click, load the first level.
			// "Stage1" is the name of the first scene we created.
			//Application.LoadLevel ("Gameplay");
			
		}
		buttonNo--;
		
		// Draw a button for Exit
		if 	(GUI.Button (new Rect (	(Screen.width) / 2 - (buttonWidth / 2),
		                           	(Screen.height - (buttonNo*ButtonDistance)),
		                          	buttonWidth,
		                           	buttonHeight),
		                 settingscreen,
		                 GUIStyle.none)
		     ) 
		{
			// On Click, load the first level.
			// "Stage1" is the name of the first scene we created.
			Application.Quit ();
		}
		buttonNo--;

		// Draw a button for Exit
		if 	(GUI.Button (new Rect (	(Screen.width) / 2 - (buttonWidth / 2),
		                           	(Screen.height - (buttonNo*ButtonDistance)),
		                          	buttonWidth,
		                           	buttonHeight),
		                 helpscreen,
		                 GUIStyle.none)
		     ) 
		{
			// On Click, load the first level.
			// "Stage1" is the name of the first scene we created.
			Application.Quit ();
		}
		buttonNo--;
		
		// Draw a button for Exit
		if 	(GUI.Button (new Rect (	(Screen.width) / 2 - (buttonWidth / 2),
		                           	(Screen.height - (buttonNo*ButtonDistance)),
									buttonWidth,
									buttonHeight),
						quitscreen,
						GUIStyle.none)
			) 
		{
			// On Click, load the first level.
			// "Stage1" is the name of the first scene we created.
			Application.Quit ();
		}
		buttonNo--;
		
	}
}
